home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / X11 / config / bsdLib.rules < prev    next >
Encoding:
Text File  |  2006-12-20  |  17.5 KB  |  575 lines

  1. XCOMM $Xorg: bsdLib.rules,v 1.3 2000/08/17 19:41:47 cpqbld Exp $
  2.  
  3.  
  4.  
  5.  
  6.  
  7. XCOMM $XFree86: xc/config/cf/bsdLib.rules,v 3.27 2003/11/20 00:41:37 dawes Exp $
  8. /*
  9.  * NetBSD/FreeBSD shared library rules
  10.  */
  11.  
  12. #ifndef UseElfFormat
  13. #define UseElfFormat NO
  14. #endif
  15.  
  16. #if NetBSDDistribution == NetBSDDebian
  17. # ifndef SharedOldX
  18. #  define SharedOldX NO
  19. # endif
  20. #endif /* Debian */
  21.  
  22. #if !UseElfFormat
  23. /* a.out shared libs */
  24. #ifndef HasSharedLibraries
  25. # ifndef Arm32Architecture
  26. #  define HasSharedLibraries YES
  27. # endif
  28. #endif
  29. #ifndef SharedDataSeparation
  30. #define SharedDataSeparation NO
  31. #endif
  32. #ifndef SharedCodeDef
  33. #define SharedCodeDef
  34. #endif
  35. #ifndef SharedLibraryDef
  36. #define SharedLibraryDef -DBSDSHLIB
  37. #endif
  38. #ifndef ShLibIncludeFile
  39. #define ShLibIncludeFile <bsdLib.tmpl>
  40. #endif
  41. #ifndef SharedLibraryLoadFlags
  42. #define SharedLibraryLoadFlags -Bshareable
  43. #endif
  44. #ifndef PositionIndependentCFlags
  45. #define PositionIndependentCFlags -fpic
  46. #endif
  47.  
  48. /*
  49.  * InstallSharedLibrary - generate rules to install the shared library.
  50.  */
  51. #ifndef InstallSharedLibrary
  52. #define InstallSharedLibrary(libname,rev,dest)                @@\
  53. install:: Concat(lib,libname.so.rev)                    @@\
  54.     MakeDir($(DESTDIR)dest)                        @@\
  55.     $(INSTALL) -c $(INSTLIBFLAGS) Concat(lib,libname.so.rev) $(DESTDIR)dest 
  56. @@\
  57.  
  58. #endif /* InstallSharedLibrary */
  59.  
  60. /*
  61.  * SharedLibraryTarget - generate rules to create a shared library;
  62.  * build it into a different name so that we do not hose people by having
  63.  * the library gone for long periods.
  64.  */
  65. #ifndef SharedLibraryTarget
  66. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  67. AllTarget(Concat(lib,libname.so.rev))                    @@\
  68.                                     @@\
  69. Concat(lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)            @@\
  70.     $(RM) $@~                            @@\
  71.     (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
  72.     $(RM) $@                            @@\
  73.     $(MV) $@~ $@                            @@\
  74.     LinkBuildLibrary($@)                        @@\
  75.                                     @@\
  76. clean::                                    @@\
  77.     $(RM) Concat(lib,libname.so.rev)
  78.  
  79. #endif /* SharedLibraryTarget */
  80.  
  81. /*
  82.  * SharedDepLibraryTarget - generate rules to create a shared library.
  83.  */
  84. #ifndef SharedDepLibraryTarget
  85. #define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up)    @@\
  86. AllTarget(Concat(lib,libname.so.rev))                    @@\
  87.                                     @@\
  88. Concat(lib,libname.so.rev):  deplist $(EXTRALIBRARYDEPS)        @@\
  89.     $(RM) $@~                            @@\
  90.     (cd down; $(LD) -o up/$@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)) @@\
  91.     $(RM) $@                            @@\
  92.     $(MV) $@~ $@                            @@\
  93.     LinkBuildLibrary($@)                        @@\
  94.                                     @@\
  95. clean::                                    @@\
  96.     $(RM) Concat(lib,libname.so.rev)
  97.  
  98. #endif /* SharedDepLibraryTarget */
  99.  
  100. /*
  101.  * SharedDepCplusplusLibraryTarget - generate rules to create a shared library.
  102.  */
  103. #ifndef SharedDepCplusplusLibraryTarget
  104. #define SharedDepCplusplusLibraryTarget(libname,rev,deplist,solist,down,up)    @@\
  105. AllTarget(Concat(lib,libname.so.rev))                    @@\
  106.                                     @@\
  107. Concat(lib,libname.so.rev):  deplist                    @@\
  108.     $(RM) $@~                            @@\
  109.     @SONAME=`echo $@ | sed 's/\.[^\.]*$$//'`; set -x; \        @@\
  110.         (cd down; $(CXX) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  111.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  112.         LinkBuildSonameLibrary($$SONAME)            @@\
  113.     $(RM) $@                            @@\
  114.     $(MV) $@~ $@                            @@\
  115.     $(RM) Concat(lib,libname.so)                    @@\
  116.     $(LN) $@ Concat(lib,libname.so)                    @@\
  117.     LinkBuildLibrary($@)                        @@\
  118.     LinkBuildLibrary(Concat(lib,libname.so))            @@\
  119.                                     @@\
  120. clean::                                    @@\
  121.     @SONAME=`echo Concat(lib,libname.so.rev) | sed 's/\.[^\.]*$$//'`; \ @@\
  122.     set -x; $(RM) $$SONAME                        @@\
  123.     $(RM) Concat(lib,libname.so)                    @@\
  124.     $(RM) Concat(lib,libname.so.rev)
  125.  
  126. #endif /* SharedDepCplusplusLibraryTarget */
  127.  
  128. #ifndef SharedDepModuleTarget
  129. #define SharedDepModuleTarget(name,deps,solist)                @@\
  130. AllTarget(name)                                @@\
  131.                                     @@\
  132. name: deps                                @@\
  133.     $(RM) $@~                            @@\
  134.     $(LD) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)        @@\
  135.     $(RM) $@                            @@\
  136.     $(MV) $@~ $@                            @@\
  137.                                     @@\
  138. clean::                                    @@\
  139.     $(RM) name
  140.  
  141. #endif /* SharedDepModuleTarget */
  142.  
  143. /*
  144.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  145.  */
  146. #ifndef SharedLibraryDataTarget
  147. #define SharedLibraryDataTarget(libname,rev,salist)
  148. #endif /* SharedLibraryDataTarget */
  149.  
  150. #ifndef InstallSharedLibraryData
  151. #define InstallSharedLibraryData(libname,rev,dest)
  152. #endif /* InstallSharedLibraryData */
  153.  
  154. /*
  155.  * SharedLibReferences - variables for shared libraries
  156.  */
  157. #ifndef SharedLibReferences
  158. #define SharedLibReferences(varname,libname,libsource,revname,rev)    @@\
  159. revname = rev                                @@\
  160. Concat3(DEP,varname,LIB) = SharedLibDependencies(libname,libsource,revname) @@\
  161. Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname)        @@\
  162. LintLibReferences(varname,libname,libsource)
  163. #endif
  164.  
  165.  /*
  166.  * SharedFontLibReferences - shared font libraries
  167.  */
  168. #ifndef SharedFontLibReferences
  169. #define SharedFontLibReferences()                    @@\
  170. SOFONTREV = SharedFontRev                        @@\
  171. DEPFONTLIB = SharedLibDependencies(Xfont,$(FONTLIBSRC),SOFONTREV)    @@\
  172. FONTLIB = -L$(FREETYPELIBDIR) -L$(FONTLIBSRC) LoaderLibPrefix -lXfont    @@\
  173. LintLibReferences(XFONT,Xfont,$(FONTLIBSRC))
  174. #endif
  175.  
  176. /*
  177.  * SharedDSLibReferences - variables for shared libraries
  178.  */
  179. #ifndef SharedDSLibReferences
  180. #define SharedDSLibReferences(varname,libname,libsource,revname,rev)    @@\
  181. revname = rev                                @@\
  182. Concat3(DEP,varname,LIB) = SharedDSLibDependencies(libname,libsource,revname) @@\
  183. Concat(varname,LIB) = LoaderLibPrefix Concat(-l,libname) Concat3(Shared,libname,Reqs)        @@\
  184. LintLibReferences(varname,libname,libsource)
  185. #endif
  186.  
  187. #else /* UseElfFormat */
  188.  
  189. /*
  190.  * NetBSD/FreeBSD (ELF) shared library rules
  191.  * Cloned from Linux ELF rules, with the following major change:
  192.  *
  193.  *     Shared libraries depend on -lc.  Since we don't have to worry
  194.  *    about libc vs. libg, etc., this is a good idea.  (This is actually
  195.  *    implied by using $(CC) to build the shared libraries.)  Adding it
  196.  *    explicitly will break threaded applications on platforms that use
  197.  *    libc_r for thread support.
  198.  */
  199.  
  200. #ifndef HasSharedLibraries
  201. #define HasSharedLibraries YES
  202. #endif
  203. #ifndef ForceNormalLib
  204. #define ForceNormalLib YES
  205. #endif
  206.  
  207. #ifndef UseRpath
  208. #define UseRpath YES
  209. #endif
  210.  
  211. #ifndef BaseShLibReqs
  212. #define BaseShLibReqs        /* -lc */
  213. #endif
  214.  
  215. #ifndef SharedDataSeparation
  216. #define SharedDataSeparation NO
  217. #endif
  218. #ifndef SharedCodeDef
  219. #define SharedCodeDef /**/
  220. #endif
  221. #ifndef SharedLibraryDef
  222. #define SharedLibraryDef /**/
  223. #endif
  224. #ifndef ShLibIncludeFile
  225. #define ShLibIncludeFile <bsdLib.tmpl>
  226. #endif
  227. #ifndef RpathLoadFlags
  228. #if UseRpath
  229. #define RpathLoadFlags -Wl,-rpath,$(USRLIBDIRPATH)
  230. #else
  231. #define RpathLoadFlags /**/
  232. #endif
  233. #endif
  234. #ifndef LibraryRpathLoadFlags
  235. #define LibraryRpathLoadFlags RpathLoadFlags
  236. #endif
  237. #ifndef SharedLibraryLoadFlags
  238. #define SharedLibraryLoadFlags -shared LibraryRpathLoadFlags
  239. #endif
  240. #ifndef PositionIndependentCFlags
  241. #define PositionIndependentCFlags -fPIC
  242. #endif
  243. #ifndef PositionIndependentCplusplusFlags
  244. #define PositionIndependentCplusplusFlags -fPIC
  245. #endif
  246. #ifndef ExtraLoadFlags
  247. #ifdef UseInstalled
  248. #define ExtraLoadFlags RpathLoadFlags
  249. #else
  250. #define ExtraLoadFlags RpathLoadFlags -Wl,-rpath-link,$(BUILDLIBDIR)
  251. #endif
  252. #endif
  253.  
  254. #ifndef HardCodeLibdirFlag
  255. #define HardCodeLibdirFlag RpathLoadFlags
  256. #endif
  257.  
  258. #if !defined(ShlibGlobalsFlags)
  259. #define ShlibGlobalsFlags -Wl,-Bsymbolic
  260. #endif
  261.  
  262. /*
  263.  * InstallSharedLibrary - generate rules to install the shared library.
  264.  * NOTE: file must be executable, hence "INSTBINFLAGS"
  265.  */
  266. #if !defined(FreeBSDArchitecture) || defined(DragonFlyArchitecture)
  267. INSTALLMINORREV = true
  268. #else
  269. INSTALLMINORREV = false
  270. #endif
  271.  
  272. #ifndef InstallSharedLibrary
  273. #define InstallSharedLibrary(libname,rev,dest)                @@\
  274. install:: Concat(lib,libname.so.rev)                     @@\
  275.     MakeDir($(DESTDIR)dest)                        @@\
  276.     @T=`echo Concat(lib,libname.so.rev) | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`;\    @@\
  277.     if $(INSTALLMINORREV); then \                    @@\
  278.       INST=Concat(lib,libname.so.rev); \                @@\
  279.       LINK=$$T; \                            @@\
  280.     else \                                @@\
  281.       INST=$$T; \                            @@\
  282.     fi; \                                @@\
  283.     (set -x; \                            @@\
  284.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) $$INST $(DESTDIR)dest); \ @@\
  285.     if [ X"$$LINK" != X ]; then (set -x; \                @@\
  286.       $(RM) $(DESTDIR)dest/$$LINK; \            @@\
  287.       $(LN) $$INST $(DESTDIR)dest/$$LINK); \            @@\
  288.     fi; \                                @@\
  289.     if $(SOSYMLINK); then (set -x; \                @@\
  290.       $(RM) Concat($(DESTDIR)dest/lib,libname.so); \    @@\
  291.       $(LN) $$T Concat($(DESTDIR)dest/lib,libname.so)); \        @@\
  292.     fi
  293. #endif /* InstallSharedLibrary */
  294.  
  295. #ifndef InstallSharedLibtoolLibrary
  296.  
  297. #define SetRevisions(rev) V=`expr rev : '\([^:]*\)'`; \            @@\
  298.         R=`expr rev : '.*:\([^:]*\):'`; \            @@\
  299.         A=`expr rev : '.*:\([^:]*\)'`; \            @@\
  300.         REV=$$V; \                        @@\
  301.         REVLIST=""; \                        @@\
  302.         i=$$A; \                        @@\
  303.         while [ $$i -gt 0 ]; do \                @@\
  304.             REVLIST="$$REVLIST `expr $$REV - $$i`"; \    @@\
  305.             i=`expr $$i - 1`; \                @@\
  306.         done
  307.  
  308. #define InstallSharedLibtoolLibrary(libname,rev,dest)            @@\
  309. install:: Concat(lib,libname.so)                     @@\
  310.     MakeDir($(DESTDIR)dest)                        @@\
  311.     @set +e; SetRevisions(rev); \                    @@\
  312.     set -e; \                            @@\
  313.     T=Concat(lib,libname.so.$$REV); \                @@\
  314.     if $(INSTALLMINORREV); then \                    @@\
  315.       INST=$$T.0; \                            @@\
  316.       LINK=$$T; \                            @@\
  317.     else \                                @@\
  318.       INST=$$T; \                            @@\
  319.     fi; \                                @@\
  320.     (set -x; \                            @@\
  321.     $(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) $$INST $(DESTDIR)dest); \ @@\
  322.     if [ X"$$LINK" != X ]; then (set -x; \                @@\
  323.       $(RM) $(DESTDIR)dest/$$LINK; \                @@\
  324.       $(LN) $$INST $(DESTDIR)dest/$$LINK); \            @@\
  325.     fi; \                                @@\
  326.     for i in $$REVLIST; do (set -x; \                @@\
  327.       $(RM) Concat($(DESTDIR)dest/lib,libname.so.$$i); \        @@\
  328.       $(LN) Concat(lib,libname.so.$$REV) Concat($(DESTDIR)dest/lib,libname.so.$$i)); \ @@\
  329.     done; \                                @@\
  330.     if $(SOSYMLINK); then (set -x; \                @@\
  331.       $(RM) Concat($(DESTDIR)dest/lib,libname.so); \        @@\
  332.       $(LN) Concat(lib,libname.so.$$REV) Concat($(DESTDIR)dest/lib,libname.so)); \                                    @@\
  333.     fi
  334. #endif /* InstallSharedLibtoolLibrary */
  335.  
  336. /*
  337.  * InstallSharedLibraryData - generate rules to install the shared library data
  338.  */
  339. #ifndef InstallSharedLibraryData
  340. #define InstallSharedLibraryData(libname,rev,dest)
  341. #endif /* InstallSharedLibraryData */
  342.  
  343.  
  344. /*
  345.  * SharedLibraryTarget - generate rules to create a shared library;
  346.  * build it into a different name so that we do not hose people by having
  347.  * the library gone for long periods.
  348.  */
  349. #ifndef SharedLibraryTarget
  350. #define SharedLibraryTarget(libname,rev,solist,down,up)            @@\
  351. AllTarget(Concat(lib,libname.so.rev))                    @@\
  352.                                     @@\
  353. Concat(lib,libname.so.rev):  solist                    @@\
  354.     $(RM) $@~                            @@\
  355.     @SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \            @@\
  356.         (set -x; cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  357.         (set -x; $(RM) $$SONAME; $(LN) $@ $$SONAME); \        @@\
  358.         LinkBuildSonameLibrary($$SONAME)            @@\
  359.     $(RM) $@                            @@\
  360.     $(MV) $@~ $@                            @@\
  361.     LinkBuildLibrary($@)                        @@\
  362.     @if $(SOSYMLINK); then (set -x; \                @@\
  363.       $(RM) Concat(lib,libname.so); \                @@\
  364.       $(LN) $@ Concat(lib,libname.so)); fi                @@\
  365.     LinkBuildLibraryMaybe(Concat(lib,libname.so),$(SOSYMLINK))    @@\
  366.                                     @@\
  367. clean::                                    @@\
  368.     @SONAME=`echo Concat(lib,libname.so.rev) | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \ @@\
  369.     set -x; $(RM) $$SONAME                        @@\
  370.     $(RM) Concat(lib,libname.so)                    @@\
  371.     $(RM) Concat(lib,libname.so.rev)
  372.  
  373. #endif /* SharedLibraryTarget */
  374.  
  375. #ifndef SharedLibtoolLibraryTarget
  376. #define SharedLibtoolLibraryTarget(libname,rev,solist,down,up)        @@\
  377. AllTarget(Concat(lib,libname.so))                    @@\
  378.                                     @@\
  379. Concat(lib,libname.so):  solist                        @@\
  380.     $(RM) $@~                            @@\
  381.     @set +e; SetRevisions(rev); \                    @@\
  382.     SONAME=$@.$$REV; \                        @@\
  383.     set -e; \                            @@\
  384.     (set -x; cd down; $(CC) -o up/$$SONAME~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  385.     (set -x; $(RM) $$SONAME; $(MV) $$SONAME~ $$SONAME); \        @@\
  386.     LinkBuildSonameLibrary($$SONAME); \                @@\
  387.     if $(INSTALLMINORREV); then (set -x; \                @@\
  388.       $(RM) $$SONAME.0; \                        @@\
  389.       $(LN) $$SONAME $$SONAME.0); \                    @@\
  390.     fi; \                                @@\
  391.     if $(SOSYMLINK); then (set -x; \                @@\
  392.       $(RM) $@; \                            @@\
  393.       $(LN) $$SONAME $@); \                        @@\
  394.       LinkBuildLibraryInline($@); \                    @@\
  395.     fi                                @@\
  396.                                     @@\
  397. clean::                                    @@\
  398.     @set +e; SetRevisions(rev); \                    @@\
  399.         set -xe; \                        @@\
  400.         $(RM) Concat(lib,libname.so.$$REV); \            @@\
  401.         $(RM) Concat(lib,libname.so.$$REV.0)            @@\
  402.     $(RM) Concat(lib,libname.so)
  403.  
  404. #endif /* SharedLibtoolLibraryTarget */
  405.  
  406. /*
  407.  * SharedDepLibraryTarget - generate rules to create a shared library.
  408.  */
  409. #ifndef SharedDepLibraryTarget
  410. #define SharedDepLibraryTarget(libname,rev,deplist,solist,down,up)    @@\
  411. AllTarget(Concat(lib,libname.so.rev))                    @@\
  412.                                     @@\
  413. Concat(lib,libname.so.rev):  deplist                    @@\
  414.     $(RM) $@~                            @@\
  415.     @SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; set -x; \        @@\
  416.         (cd down; $(CC) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  417.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  418.         LinkBuildSonameLibrary($$SONAME)            @@\
  419.     $(RM) $@                            @@\
  420.     $(MV) $@~ $@                            @@\
  421.     $(RM) Concat(lib,libname.so)                    @@\
  422.     $(LN) $@ Concat(lib,libname.so)                    @@\
  423.     LinkBuildLibrary($@)                        @@\
  424.     LinkBuildLibrary(Concat(lib,libname.so))            @@\
  425.                                     @@\
  426. clean::                                    @@\
  427.     @SONAME=`echo Concat(lib,libname.so.rev) | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \ @@\
  428.     set -x; $(RM) $$SONAME                        @@\
  429.     $(RM) Concat(lib,libname.so)                    @@\
  430.     $(RM) Concat(lib,libname.so.rev)
  431.  
  432. #endif /* SharedDepLibraryTarget */
  433.  
  434. /*
  435.  * SharedDepCplusplusLibraryTarget - generate rules to create a shared library.
  436.  */
  437. #ifndef SharedDepCplusplusLibraryTarget
  438. #define SharedDepCplusplusLibraryTarget(libname,rev,deplist,solist,down,up)    @@\
  439. AllTarget(Concat(lib,libname.so.rev))                    @@\
  440.                                     @@\
  441. Concat(lib,libname.so.rev):  deplist                    @@\
  442.     $(RM) $@~                            @@\
  443.     @SONAME=`echo $@ | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; set -x; \        @@\
  444.         (cd down; $(CXX) -o up/$@~ $(SHLIBLDFLAGS) -Wl,-soname,$$SONAME solist $(REQUIREDLIBS) BaseShLibReqs); \ @@\
  445.         $(RM) $$SONAME; $(LN) $@ $$SONAME; \            @@\
  446.         LinkBuildSonameLibrary($$SONAME)            @@\
  447.     $(RM) $@                            @@\
  448.     $(MV) $@~ $@                            @@\
  449.     $(RM) Concat(lib,libname.so)                    @@\
  450.     $(LN) $@ Concat(lib,libname.so)                    @@\
  451.     LinkBuildLibrary($@)                        @@\
  452.     LinkBuildLibrary(Concat(lib,libname.so))            @@\
  453.                                     @@\
  454. clean::                                    @@\
  455.     @SONAME=`echo Concat(lib,libname.so.rev) | sed 's/\(lib[^\.]*\.so\.[0-9]*\)\(\.[0-9]*\)\{1,2\}/\1/'`; \ @@\
  456.     set -x; $(RM) $$SONAME                        @@\
  457.     $(RM) Concat(lib,libname.so)                    @@\
  458.     $(RM) Concat(lib,libname.so.rev)
  459.  
  460. #endif /* SharedDepCplusplusLibraryTarget */
  461.  
  462. #ifndef SharedDepModuleTarget
  463. #define SharedDepModuleTarget(name,deps,solist)                @@\
  464. AllTarget(name)                                @@\
  465.                                     @@\
  466. name: deps                                @@\
  467.     $(RM) $@~                            @@\
  468.     $(CC) -o $@~ $(SHLIBLDFLAGS) solist $(REQUIREDLIBS)        @@\
  469.     $(RM) $@                            @@\
  470.     $(MV) $@~ $@                            @@\
  471.                                     @@\
  472. clean::                                    @@\
  473.     $(RM) name
  474.  
  475. #endif /* SharedDepModuleTarget */
  476.  
  477. #ifndef SharedDriModuleTarget
  478. #define SharedDriModuleTarget(name,deps,solist)                @@\
  479. AllTarget(name)                                @@\
  480.                                     @@\
  481. name: deps                                @@\
  482.     $(RM) $@~ $@.map                        @@\
  483.     @(echo 'DRI_MODULE { global: __dri*; local: *; };' > $@.map)    @@\
  484.     $(CC) -o $@~ -Wl,--version-script=$@.map $(SHLIBLDFLAGS) solist $(REQUIREDLIBS) BaseShLibReqs @@\
  485.     $(RM) $@ $@.map                            @@\
  486.     $(MV) $@~ $@                            @@\
  487.                                     @@\
  488. clean::                                    @@\
  489.     $(RM) name                            @@\
  490.     $(RM) name.map
  491.  
  492. #endif /* SharedDriModuleTarget */
  493.  
  494. /*
  495.  * SharedLibraryDataTarget - generate rules to create shlib data file;
  496.  */
  497. #ifndef SharedLibraryDataTarget
  498. #define SharedLibraryDataTarget(libname,rev,salist)
  499. #endif /* SharedLibraryTarget */
  500.  
  501. #if defined(FreeBSDArchitecture)
  502.  
  503. /*
  504.  * Support for building a.out compatibility libraries on a FreeBSD/ELF system.
  505.  */
  506. #ifndef BuildAoutLibraries
  507. #define BuildAoutLibraries NO
  508. #endif
  509.  
  510. #if BuildAoutLibraries
  511.  
  512. #define ExtraLibRules
  513.  
  514. #ifndef AoutSharedLibraryDef
  515. #define AoutSharedLibraryDef -DBSDSHLIB
  516. #endif
  517. #ifndef AoutSharedLibraryLoadFlags
  518. #define AoutSharedLibraryLoadFlags -aout -Bshareable
  519. #endif
  520. #ifndef AoutPositionIndependentCFlags
  521. #define AoutPositionIndependentCFlags -fpic
  522. #endif
  523.  
  524. /*
  525.  * InstallAoutSharedLibrary - generate rules to install the shared library.
  526.  */
  527. #ifndef InstallAoutSharedLibrary
  528. #define InstallAoutSharedLibrary(libname,rev,dest)            @@\
  529. install:: Concat(aout/lib,libname.so.rev)                @@\
  530.     MakeDir($(DESTDIR)dest)                        @@\
  531.     $(INSTALL) -c $(INSTLIBFLAGS) Concat(aout/lib,libname.so.rev) $(DESTDIR)dest 
  532. @@\
  533.  
  534. #endif /* InstallAoutSharedLibrary */
  535.  
  536. /*
  537.  * AoutSharedLibraryTarget - generate rules to create a shared library;
  538.  * build it into a different name so that we do not hose people by having
  539.  * the library gone for long periods.
  540.  */
  541. #ifndef AoutSharedLibraryTarget
  542. #define AoutSharedLibraryTarget(libname,rev,solist,down,up)        @@\
  543. AllTarget(Concat(down/lib,libname.so.rev))                @@\
  544.                                     @@\
  545. Concat(down/lib,libname.so.rev):  solist $(EXTRALIBRARYDEPS)        @@\
  546.     $(RM) $@~                            @@\
  547.     (cd down; $(LD) -o up/$@~ AoutSharedLibraryLoadFlags solist)    @@\
  548.     $(RM) $@                            @@\
  549.     $(MV) $@~ $@                            @@\
  550.                                     @@\
  551. clean::                                    @@\
  552.     $(RM) Concat(down/lib,libname.so.rev)
  553.  
  554. #endif /* AoutSharedLibraryTarget */
  555.  
  556. #define AoutCDebugFlags -aout DefaultCDebugFlags
  557. #define AoutCplusplusDebugFlags -aout DefaultCplusplusDebugFlags
  558.  
  559. #define AoutLibObjCompile(options) LibObjCompile(aout,AoutCDebugFlags AoutSharedLibraryDef AoutPositionIndependentCFlags options)
  560. #define AoutLibObjCplusplusCompile(options) LibObjCompile(aout,AoutCplusplusDebugFlags options)
  561.  
  562. #define ExtraLibMkdir() _LibMkdir(aout)
  563. #define ExtraObjCompile(options) AoutLibObjCompile(options)
  564. #define ExtraObjCplusplusCompile(options) AoutLibObjCplusplusCompile(options)
  565. #define ExtraCleanDir() LibCleanDir(aout)
  566.  
  567. #define ExtraLibraryTarget(libname,so,objs) AoutSharedLibraryTarget(libname,so,objs,aout,..)
  568. #define ExtraInstallLibrary(libname,so) InstallAoutSharedLibrary(libname,so,$(SHLIBDIR)/aout)
  569.  
  570. #endif
  571. #endif
  572.  
  573.  
  574. #endif /* UseElfFormat */
  575.